package com.springcloud.alibaba.fegin.consumer.controller;

import com.springcloud.alibaba.fegin.consumer.client.ProviderServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:RenPu
 * @Date: 2020/6/30 16:28
 * @Version: 1.0
 * @description:
 */

@RestController
@Slf4j
public class ConsumerFeginController {

    @Resource
    private ProviderServer providerServer;

    @GetMapping(value = "/consumer/fegin/{id}")
    public String testConsumerFegin(@PathVariable(value = "id") Integer id){

        return providerServer.testHystrixDuan( id );

    }


    @GetMapping(value = "/fegin/testTimeOut/{id}")
    public String testTimeOut(@PathVariable(value = "id") Integer id){
       return providerServer.testHystrixJiangJi( id );
    }


}
